1. Technical Field
The present invention generally relates to touch technologies and, more particularly, to an optical touch system, an apparatus and a method for more accurately calculating the position of an object.
2. Description of the Related Art
FIG. 1 is a perspective view of an optical touch system in prior art. Referring to FIG. 1, the optical touch system 100 includes a panel 104, apparatuses 106 and 108 for calculating the position of an object, a coordinates-calculating apparatus 110 and reflectors 112 through 116. The apparatus 106 includes an image sensor 106A and a processing circuit 106B. The apparatus 108 includes an image sensor 108A and a processing circuit 108B. The processing circuits 106B and 108B are electrically coupled to the image sensors 106A and 108A respectively, so as to receive the sensed images from the image sensors 106A and 108A respectively. And each of the processing circuits 106B and 108B further calculates a gravity of an imaging range of the object 102 in the received sensed image so as to regard the gravity as a representative position of the object 102 in the received sensed image. The coordinates-calculating apparatus 110 is electrically coupled to the processing circuits 106B and 108B, so as to receive the two representative positions from the processing circuits 106B and 108B respectively. After that, the coordinates-calculating apparatus 110 calculates the relative coordinates of the object 102 on a touch surface 118 according to the two representative positions.
As shown in FIG. 1, the touch surface 118 is a quadrilateral area, which is preferably shaped in rectangle. The reflectors 112 through 116 are all used for reflecting light to the touch surface 118, and all of the reflectors do not form any mirror image of the touch surface 118.
FIG. 2 is a schematic view of the optical touch system 100 with single touch. In FIGS. 1 and 2, the objects of uniform labels represent the same element. As shown in FIG. 2, the image sensor 106A can sense the object 102 along the sensing path 202, and the image sensor 108A can sense the object 102 along the sensing path 204. Thus, as long as the crossing point of the sensing paths 202 and 204 can be obtained, the position of the pointer 102 can be acquired.
The processing circuit 106B calculates a gravity of an imaging range of the object 102 according to a sensed image sensed by the image sensor 106, so as to further regard the gravity as a representative position of the object 102 in the sensed image and output the representative position to the coordinates-calculating apparatus 110. Thus, the coordinates-calculating apparatus 110 can further acquire a straight line equation of the sensing path 202 in accordance with the respective position. Similarly, the processing circuit 108B calculates a gravity of an imaging range of the object 102 according to a sensed image sensed by the image sensor 108, so as to further regard the gravity as a representative position of the object 102 in the sensed image and output the representative position to the coordinates-calculating apparatus 110. Thus, the coordinates-calculating apparatus 110 can further acquire a straight line equation of the sensing path 204 in accordance with the respective position. However, the gravities calculated by the processing circuits 106B and 108B often have deviation, so that the coordinates of the object 102 calculated by the coordinates-calculating apparatus 110 may have some error. Further explanation is given as follows.
Take an operation of the apparatus 106 as an example. Before the object 102 touches the touch surface 118, the processing circuit 106B controls the image sensor 106A to sense the touch surface 118, so as to obtain an image. The image does not contain any image of the object 102. And the processing circuit further regards the image as a background image. Then, the processing circuit 106B acquires a brightness value of at least one pixel in each pixel column of the background image, so as to obtain a brightness distribution profile. For example, the processing circuit 106B can acquire the brightness values of the N brightest pixels in each pixel column of the background and calculate an average brightness value or a total brightness value of the N brightest pixels in each pixel column to obtain a brightness distribution profile, wherein N is a natural number. Certainly, the processing circuit 106B also can acquire the brightness values of a plurality of pixels whose brightness values are larger than a predetermined value in each pixel column of the background image, so as to calculate an average brightness value of the plurality of pixels whose brightness values are larger than the predetermined value to obtain a brightness distribution profile. Since the brightness of the background is usually non-homogeneous, the brightness distribution profile is presented as a curve. FIG. 3 is an exemplary brightness distribution profile obtained from the background image, each dot of the curve shown in FIG. 3 represents a column pixel brightness value of the background image.
When the object 102 touches the touch surface 118, the processing circuit 106B obtains an image containing an image of the object 102 through the image sensor 106A. FIG. 4 is a schematic view of an image sensed by the image sensor. In FIG. 4, label 400 represents an image sensing window of the image sensor 106A. A white zone labeled by 402 is a bright zone with a higher brightness in the image, and the bright zone is formed by the light reflected by the reflectors 114 and 116. The bright zone 402 is the main sensing area. Label 404 represents a dark stripe formed by the object 102.
When the image containing an image of the object 102 is obtained, the processing circuit 106B regards the obtained image as a sensed image and further obtains a brightness distribution profile of the sensed image by the same way of obtaining the above brightness distribution profile. FIG. 5 is an exemplary brightness distribution profile obtained from the sensed image, each dot of the curve shown in FIG. 5 represents a column pixel brightness value of the sensed image. In FIG. 5, a range labeled by W is a range with low brightness formed by the object 102. Then, the processing circuit 106B compares the two brightness distribution profiles shown in FIGS. 3 and 5 to obtain the brightness difference between the two brightness distribution profiles, so as to determine a plurality of column pixel brightness values in the brightness distribution profile of the sensed image as an imaging range of the object 102. For example, after obtaining the brightness difference between the two brightness distribution profiles, the processing circuit 106B determines a distribution range of a plurality of column pixel brightness values in the brightness distribution profile of the sensed image as an imaging range of the object 102. There is a brightness difference lager than a predetermined brightness difference between each column pixel brightness value in the distribution range and each column pixel brightness value in a corresponding range in the brightness distribution profile of the background image. In other words, a distribution range of column pixels with the predetermined brightness difference is regarded as an imaging range of the object 102 in the image sensing window 400 of the image sensor 106 A. In this embodiment, a range labeled by W in FIG. 5 is an imaging range corresponding to the above description.
After the imaging range of the object 102 is obtained, the processing circuit 106B calculates the brightness difference between the curve segments related to the obtained imaging range of the two brightness distribution profiles, so as to further calculate a gravity of the imaging range of the object 102. FIG. 6 shows the curve segments related to the obtained imaging range of the two brightness distribution profiles. In FIG. 6, a range labeled by W is a range with low brightness formed by the object 102. The curve segment formed by the dots B0-BN is a curve segment related to the imaging range of the brightness distribution profile of the background image. The curve segment formed by the dots SO-SN is a curve segment related to the imaging range of the brightness distribution profile of the sensed image, wherein N is a natural number. Supposing that the positions of the dots B0-BN in the x-axis of the image sensing window 400 are X0-XN in turn, and the positions of the dots SO-SN in the x-axis of the image sensing window 400 are also X0-XN in turn, the processing circuit 106B can calculate the gravity of the imaging range of the object 102 in accordance with an equation (1) as follows.
                    G        =                                            ∑                              i                =                0                            N                        ⁢                          Δ              ⁢                                                          ⁢                                                I                  i                                ·                                  X                  i                                                                                        ∑                              i                =                0                            N                        ⁢                          Δ              ⁢                                                          ⁢                              I                i                                                                        (        1        )            Wherein, G represents the gravity, ΔIi=Bi−Si, ΔIi represents the brightness difference.
Generally speaking, the more close the calculated gravity approaches to the center of the range W, the more accurate the object position will be obtained. The center of the range W can be represented by following equation (2).
                    C        =                                            X              0                        +                          X              N                                2                                    (        2        )            Wherein, C represents the center. However, since the background brightness is inconsistent, the gradient of the curve segment formed by B0˜BN changes, so that the gravity calculated by the processing circuit 106B may deviate along with the gradient of the curve segment. This will further make the calculated gravity farther away from the center. Since the gravity calculated by the processing circuit 106B may has deviation, the coordinates of the object 102 calculated by the coordinates-calculating apparatus 110 may have some error.